import 'package:flutter/material.dart';
import 'package:model_viewer_plus/model_viewer_plus.dart';
import 'package:word_card/pages/test1/test_details1.dart';

class TestFirst extends StatefulWidget {
  const TestFirst({Key? key}) : super(key: key);

  @override
  State<TestFirst> createState() => _TestFirstState();
}

class _TestFirstState extends State<TestFirst> {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.grey[200],
      child: Column(
        children: [
          GestureDetector(
            onTap: () {
              Navigator.of(context).push(
                MaterialPageRoute(
                  builder: (context) {
                    return const TestDetailFirst();
                  },
                ),
              );
            },
            child: Container(
              margin: const EdgeInsets.all(15),
              padding: const EdgeInsets.all(15),
              width: double.maxFinite,
              decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(8), color: Colors.white),
              child: Row(
                children: [
                  Container(
                    color: Colors.white,
                    width: 100,
                    height: 100,
                    child: ModelViewer(
                      // backgroundColor: const Color.fromARGB(0xFF, 0xEE, 0xEE, 0xEE),
                      src: 'assets/free_car_001.glb', // a bundled asset file
                      alt: "A 3D model of an car",
                      ar: false,
                      // arModes: const ['scene-viewer', 'webxr', 'quick-look'],
                      autoRotate: true,
                      cameraControls: false,
                      // iosSrc: 'https://modelviewer.dev/shared-assets/models/Astronaut.usdz',
                      autoRotateDelay: 0,
                      interactionPrompt: InteractionPrompt.none,
                    ),
                  ),
                  const SizedBox(
                    width: 15,
                  ),
                  Expanded(
                    flex: 1,
                    child: SizedBox(
                      height: 100,
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          const Expanded(
                            flex: 1,
                            child: Text(
                              'A 3D model of an car',
                              style: TextStyle(fontSize: 20),
                            ),
                          ),
                          Container(
                            alignment: Alignment.centerRight,
                            child: Text(
                              'details',
                              style: TextStyle(color: Colors.grey[400]),
                            ),
                          )
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}
